// 请求接口
import { Request } from './request'
// 导出请求接口
// 欢迎页
module.exports.Banners = () => Request({
  url: "/banner/list",
  method: "get"
})
// 首页 九宫格接口
module.exports.navBar = () => Request({
  url: "/shop/goods/category/all",
  method: "post"
})
// 秒杀商品接口
module.exports.goods = () => Request({
  url: "/shop/goods/list",
  method: "post"
})
// 商品详情
module.exports.goodsinfo = (id) => Request({
  url: `/shop/goods/detail?id=${id}`
})
// 注册
module.exports.register = (id) => Request({
  url: `/user/wxapp/register/simple?code=${id}`,
  method: 'post'
})
// 登录
module.exports.login = (id) => Request({
  url: `/user/wxapp/login?code=${id}`,
  method: 'post'
})
// 购物车数据
module.exports.cartlist = (token) => Request({
  url: `/shopping-cart/info?token=${token}`,
})
// 购物车Number数据
module.exports.cartNum = (url) => Request({
  url,
  method: 'post',
})
// 购物车删除数据
module.exports.cartdel = (url) => Request({
  url,
  method: 'post',
})
// 购物车添加数据
module.exports.cartadd = (url) => Request({
  url,
  method: 'post',
})
// 检测收藏
module.exports.checkCollect = (url) => Request({
  url,
  method: 'post',
})
// 添加收藏
module.exports.collect = (url) => Request({
  url,
  method: 'post',
})
// 收藏列表
module.exports.collectAll = (url) => Request({
  url,
  method: 'post',
})
// 删除收藏
module.exports.collectdel = (url) => Request({
  url,
  method: 'post',
})
// 分类左侧菜单
module.exports.List = () => Request({
  url: "/shop/goods/category/all",
  method: "get"
})
// 右側
module.exports.Banner = () => Request({
  url: "/shop/goods/list",
  method: "post"
})
// 收货地址
module.exports.address = (data) => Request({
  url:`/user/shipping-address/list?token=${data}`,
})
// 添加收货地址
module.exports.Address = (url) => Request({
  url,
  method:'post',
})
// 修改收货地址
module.exports.editAddress = (url) => Request({
  url,
  method:'post',
})
// 删除收货地址
module.exports.delAddress = (url) => Request({
  url,
  method:'post',
})
module.exports.isLogin=()=>{
  wx.showToast({
    title: "未登录",
    icon: 'none',
    duration: 2000
  })
}
